<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>添加文章</title>
    <link href="/static/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/static/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/static/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/static/admin/css/animate.css" rel="stylesheet">


    <link rel="stylesheet" type="text/css" href="/static/admin/css/plugins/simditor/simditor.css"/>
    <link href="/static/admin/css/style.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>添加文章</h5>
                </div>
                <div class="ibox-content">
                    <form method="post" action="{:url('Article/add')}" class="form-horizontal">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">选择分类</label>
                            <div class="col-sm-6">
                                <select name="category_id" id="category_id" class="form-control">
                                    {volist name="categories" id="vo"}
                                    <option value="{$vo.id}">{:html_entity_decode($vo.title)}</option>
                                    {/volist}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">文章标题</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" name="title">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">文章标签</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" name="tags" placeholder="以逗号隔开">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">文章内容</label>
                            <div class="col-sm-10">
                                <textarea id="editor" placeholder="这里输入内容" autofocus name="body"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">是否置顶</label>

                            <div class="col-sm-6">
                                <label class="radio-inline i-checks">
                                    <input type="radio" name="is_top" value="1" checked>是</label>
                                <label class="radio-inline i-checks">
                                    <input type="radio" name="is_top" value="0">否</label>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">是否开启评论</label>

                            <div class="col-sm-6">
                                <label class="radio-inline i-checks">
                                    <input type="radio" name="is_comment" value="1" checked>是</label>
                                <label class="radio-inline i-checks">
                                    <input type="radio" name="is_comment" value="0">否</label>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">状态</label>

                            <div class="col-sm-6">
                                <label class="radio-inline i-checks">
                                    <input type="radio" name="status" value="1" checked>是</label>
                                <label class="radio-inline i-checks">
                                    <input type="radio" name="status" value="0">否</label>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-primary" type="submit">保存</button>
                                <button class="btn btn-white" type="button" onclick="history.go(-1)">取消</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 全局js -->
<script src="/static/admin/js/jquery.min.js?v=2.1.4"></script>
<script src="/static/admin/js/bootstrap.min.js?v=3.3.6"></script>

<!-- 自定义js -->
<script src="/static/admin/js/content.js?v=1.0.0"></script>

<!-- iCheck -->
<script src="/static/admin/js/plugins/iCheck/icheck.min.js"></script>

<!-- simditor -->
<script type="text/javascript" src="/static/admin/js/plugins/simditor/module.js"></script>
<script type="text/javascript" src="/static/admmin/js/plugins/simditor/uploader.js"></script>
<script type="text/javascript" src="/static/admin/js/plugins/simditor/hotkeys.js"></script>
<script type="text/javascript" src="/static/admin/js/plugins/simditor/simditor.js"></script>
<script>
    $(document).ready(function () {
        var toolbar = ['title', 'bold', 'italic','underline', 'strikethrough',
            'color', '|', 'ol', 'ul', 'blockquote', 'code', 'table', '|',
            'link', 'image', 'hr', '|', 'indent', 'outdent'];
        var editor = new Simditor({
            textarea: $('#editor'),
            toolbar: toolbar,
            defaultImage: '/uploads/1.png',
            upload: {
                url: "{:url('Attachment/editorUpload')}", //文件上传的接口地址
                params: null, //键值对,指定文件上传接口的额外参数,上传的时候随文件一起提交
                fileKey: 'fileDataFileName', //服务器端获取文件数据的参数名
                connectionCount: 3,
                leaveConfirm: '正在上传文件'
            }
        });
    });
</script>

<script>
    $(document).ready(function () {
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
    });
</script>


</body>

</html>
